package cn.itsource.controller;

import cn.itsource.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RequestMapping("/order")
@RestController
public class OrderController {
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/get")
    public User getahio() {
        String url = "http://USER-SERVER/user/get";
        return restTemplate.getForObject(url, User.class);
    }
}
